//package cn.stylefeng.guns.run;
//
//import cn.stylefeng.guns.constant.Constant;
//import cn.stylefeng.guns.modular.info.entity.League;
//import cn.stylefeng.guns.modular.info.entity.Team;
//import cn.stylefeng.guns.modular.info.mapper.LeagueMapper;
//import cn.stylefeng.guns.modular.info.mapper.TeamMapper;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.CommandLineRunner;
//import org.springframework.stereotype.Component;
//
//import java.util.List;
//
///**
// * @创建人 xiesm
// * @创建时间 2021/1/23
// * @描述
// */
//@Component
//public class FootRunner implements CommandLineRunner {
//
//    @Autowired(required = false)
//    private TeamMapper teamMapper;
//    @Autowired(required = false)
//    private LeagueMapper leagueMapper;
//
//    @Override
//    public void run(String... args) throws Exception {
//        List<Team> teams = teamMapper.selectList(null);
//        teams.stream().forEach(team -> {
//            Constant.teamIdDict.put(team.getId(), team.getName());
//            Constant.teamNameDict.put(team.getName(), team.getId());
//        });
//        List<League> leagues = leagueMapper.selectList(null);
//        leagues.stream().forEach(league -> Constant.leagues.put(league.getId(), league.getName()));
//    }
//}
